#include "fxcc/yml/Serializer.h"
#include "fxcc/core/graph/common/ProjSub.h"

using namespace fxcc::yml;
using CType = fxcc::graph::common::ProjSub;;

template<>
void Serializer::Encode<CType>(YAML::Node& node, const CType& inst)
{
	SetVariable<fxcc::graph::common::Frustum>(node, "frustum", inst.m_Frustum);
	SetVariable<fxcc::graph::common::Viewport>(node, "viewport", inst.m_Viewport);
	SetVariable<bool>(node, "isOrtho", inst.m_IsOrtho);
}


template<>
bool Serializer::Decode<CType>(const YAML::Node& node, CType& inst)
{
	GetVariable<fxcc::graph::common::Frustum>(node, "frustum", inst.m_Frustum);
	GetVariable<fxcc::graph::common::Viewport>(node, "viewport", inst.m_Viewport);
	GetVariable<bool>(node, "isOrtho", inst.m_IsOrtho);

	return true;
}